package com.heima.user.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.user.userDto.UserDto;
import com.heima.user.service.ApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/login")
@Slf4j
@Api(tags = "用户相关接口")
public class ApUserController {
    @Autowired
    private ApUserService apUserService;

    /**
     * 登录
     * @param userDto
     * @return
     */
    @PostMapping("/login_auth")
    @ApiOperation("登录接口")
    public ResponseResult login(@RequestBody UserDto userDto){
        //1.接受参数
        // 2.调用service完成登录
         //3.响应结果
    log.info("登录，接参：{}",userDto);
      return apUserService.login(userDto);
    }
}
